/* z-topbar begin */
$(function(){
             $(".z-topbar .topContent .fr .phone").mouseover(function(){
                  $(".z-topbar .topContent img").show();
                  $(".z-topbar .topContent .fr .phone").css({"background":"url(/project/style/images/index/m01.jpg) no-repeat left center #fff"});
             });
             $(".z-topbar .topContent .fr .phone").mouseout(function(){
                  $(".z-topbar .topContent img").hide();
                  $(".z-topbar .topContent .fr .phone").css({"background":"url(/project/style/images/index/m01.jpg) no-repeat left center"});
             });

             $(".z-topbar .topContent .fr .myrzList").mouseover(function(){
                  $(".z-topbar .topContent .myrzList ul").show();
             });
             $(".z-topbar .topContent .fr .myrzList").mouseleave(function(){
                  $(".z-topbar .topContent .myrzList ul").hide();
             });
             $(".z-topbar .topContent .myrzList ul").mouseover(function(){
                  $(".z-topbar .topContent .myrzList ul").show();
             });
             $(".z-topbar .topContent .myrzList ul").mouseleave(function(){
                  $(".z-topbar .topContent .myrzList ul").hide();
             });
})
/*z-topbar end*/
/*z-mainNav begin*/
$(function(){
            $(".z-mainNav .fl .nav-ul li").mouseover(function(){
                var index=$(this).index();
                $(".z-mainNav .fl .nav-ul li").css("background","#000");
                $(".z-mainNav .fl .nav-ul li:eq("+index+")").css("background","#403838");
                var num=30+index*55;
                $("#z-caret").css("top",parseInt(num)+"px");
                $("#z-caret").show();
                $(".hideList").html(mainNavSetData(index)).show();
            });
            $(".contr").mouseleave(function(){
                $(".hideList").hide();
                $(".z-mainNav .fl .nav-ul li").css("background","#000");
                $("#z-caret").hide();
            }); 
          
            $(".z-mainNav .fr .aside .title span").mouseover(function(){
                var index=$(this).index();
                $(".z-mainNav .fr .aside .content p").hide();
                $(".z-mainNav .fr .aside .content p:eq("+index+")").show();
                $(".z-mainNav .fr .aside .title span").css({"background":"#fff","color":"#000"});
                $(".z-mainNav .fr .aside .title span:eq("+index+")").css({"background":"#4BC26A","color":"#fff"});
            });

})
/*z-mainNav end*/
/*z-adv begin*/
$(function(){
		//获取时间戳
		var get_unix_time = function (dateStr){
				var newstr   = dateStr.replace(/-/g,'/'); 
				var date     =  new Date(newstr); 
				var time_str = date.getTime().toString();
				return time_str.substr(0, 10);
			}
		//倒计时开始
		var Timer = function(seletor , endTimeStr){
			var NowTime = Date.parse(new Date())/1000;
			var EndTime = endTimeStr;
			var EndTime = get_unix_time(EndTime);
			if(EndTime > NowTime ){
				var t=EndTime - NowTime;
				var h=Math.floor(t/60/60);
				var m=Math.floor(t/60%60);
				var s=Math.floor(t%60);			
				seletor.find(".time_m").html(m);
				seletor.find(".time_s").html(s);
				seletor.find(".time_h").html(h);
			}else{
				seletor.find(".time").html('抢购结束！');
			}
		}
		var XianshiArr = $("#xianshi>li");//获取抢购物品
		//执行倒计时
		function test(){
			for(var i=0;i < XianshiArr.length;i++){
				var index=$(XianshiArr[i]).index();
				var time= $(XianshiArr[i]).attr("endTime");  
			Timer(XianshiArr.eq(i),time);}
			};   
        setInterval(test,1000);			
})
$(function(){
    $(".z-adv .adv-ul li").mouseover(function(){
       var num=$(this).index();
       $(".z-adv .adv-allList .adv-list").hide();
       $(".z-adv .adv-allList .adv-list:eq("+num+")").show();
       $(".z-adv .adv-ul li a").css({"border-bottom":"2px #f5f5f5 solid","color":"#000"});
       $(".z-adv .adv-ul li:eq("+num+") a").css({"border-bottom":"2px #07b487 solid","color":"#07b487"});

    })
})
/*content end*/
/*footer begin*/
/*footer end*/								    
